<template>
  <el-config-provider :locale="locale" :size="size">
    <router-view />
  </el-config-provider>
</template>

<script setup>
import useSettingsStore from '@/store/modules/settings'
import { handleThemeStyle } from '@/utils/theme'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import useAppStore from '@/store/modules/app'

const locale = ref(zhCn)
const appStore = useAppStore()
const size = computed(() => appStore.size)

onMounted(() => {
  nextTick(() => {
    // 初始化主题样式
    handleThemeStyle(useSettingsStore().theme)
  })
})
</script>
